Repository navigation
Preserve Python exceptions, fix PyO3 panics, and keep Arrow extensions - #12327
lwwmanning wants to merge 3 commits into
Conversation
… metadata Signed-off-by: Will Manning <will@willmanning.io>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
roborev: Combined Review (
|
lwwmanning
left a comment
There was a problem hiding this comment.
Posted by Claude Opus 5.5 on Will's behalf.
Keeping the original Python exception is a good fix.
vortex-layout/src/scan/arrow.rsline 73:VortexFile.to_arrow()(vortex-python/src/file.rsline 598) still goes through thisto_record_batch, which calls the panickingRecordBatch::from. A file whose root is a nullable struct with null rows still panics there, as Codex said. The dataset and iterator paths in this PR have the same shape: a non-nullable struct target, then a struct to record batch conversion. Please put the checked conversion in the sharedto_record_batchinvortex-layout, and call it fromdataset.rsline 547 anditer/mod.rsline 216. Then you can removestruct_array_to_record_batchfromvortex-python/src/arrow.rsline 317, and all three paths are covered.vortex-python/test/test_fork.pylines 38 to 43: this change is outside the scope of the title and description. It also removes the only tests that unpickle aVortexFile(pickled_file_reads_in_child) and avortex.Array(write_after_parent_write) in a fresh interpreter underspawnandforkserver. The new docstring on lines 6 to 9 saysVortexFilepickling is still covered, but it is not. Please revert this file. If you keep it, add both scenarios underspawn.- Note: callers that caught
RuntimeErrornow getOSError,EOFError,BufferErrororValueError. Thetest_file.pychange shows this. Please name this as a user-visible behavior change in the description.
…_fork.py Move the checked StructArray-to-RecordBatch conversion into vortex-layout::scan::arrow::to_record_batch (preserving InvalidArgumentError via vortex_err_to_arrow) so VortexFile.to_arrow(), VortexDataset.to_record_batch_reader(), and ArrayIterator.to_arrow() all reject top-level struct nulls cleanly, and revert the out-of-scope test_fork.py change. Signed-off-by: Will Manning <will@spiraldb.com> Co-Authored-By: Will Manning <will@spiraldb.com>
|
Addressed all three points in
|
Signed-off-by: Will Manning <will@spiraldb.com> Co-Authored-By: Will Manning <will@spiraldb.com>
lwwmanning
left a comment
There was a problem hiding this comment.
Posted by Claude Opus 5.5 on Will's behalf.
Commit c7c8de7 resolves the earlier review. The checked conversion now sits in the shared to_record_batch in vortex-layout, so the file, dataset and iterator readers return an error and do not panic. The new test_file.py case covers the file and dataset paths, and test_fork.py now matches develop again.
One note for the description: to_record_batch (which was pub(crate)) and vortex_err_to_arrow are now public API in vortex-layout.
Python callbacks in
readable.rsandPythonArrayIteratorpreviously formattedPyErrintovortex_err!, turningOSError,EOFError,BufferError,ValueError, andKeyboardInterruptintoRuntimeError; they now attach the originalPyErrviaVortexError::externalandPyVortexErrorwalks the error source chain to re-raise it (withArrayIterator.__next__wrappingStopIterationinRuntimeErrorper PEP 479 so read failures cannot silently truncate iteration). Also eliminates Rust panics across PyO3 when converting nullableStructArrays with top-level nulls toRecordBatch(shared viavortex-layout::scan::arrow::to_record_batchandvortex_err_to_arrow, nowpubinvortex-layout, across file, dataset, and iterator exports) or settingStructScalardict entries, and preserves Arrow extension field metadata during chunked and single extension array exports (related to #11114).Behavior change: callers that previously caught
RuntimeErrorfrom failing Python reader or iterator callbacks now receive the originalOSError,EOFError,BufferError,ValueError, orKeyboardInterrupt.Assisted by Antigravity.